﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="author" content="ISUX">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>学生详细信息</title>
    <link rel="stylesheet" href="/ViewMob/css/wxui.css?ver=1">
    <link href="//at.alicdn.com/t/font_qqztt1cpq09kke29.css" rel="stylesheet" />
    <link href="/ViewMob/js/layer/need/layer.css" rel="stylesheet" />
    <script src="/ViewMob/js/layer/layer.m.js"></script>
    <style>
        .page {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            opacity: 0;
            z-index: 1;
        }

            .page.js_show {
                opacity: 1;
            }

        .page__hd {
            background: #4faeff url(../images/bg-account.jpg) 100% 100%;
            padding: 1rem 0;
            text-align: center;
            color: #fff;
        }

        .page__bd_spacing {
            padding: 0 15px;
        }

        .page__ft {
            padding-top: 40px;
            padding-bottom: 10px;
            text-align: center;
        }

            .page__ft img {
                height: 19px;
            }

            .page__ft.j_bottom {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
            }

        .page__title {
            text-align: left;
            font-size: 14px;
            font-weight: 200;
        }

        .page__desc {
            margin-top: 5px;
            color: #888;
            text-align: left;
            font-size: 14px;
        }

        .head-oneself {
            width: 4.5rem;
            height: 4.5rem;
            margin-left: 20px;
        }

            .head-oneself img {
                border: 2px solid rgba(0,0,0,.2);
            }



        .zt {
            background-color: lightgray;
            font-size: 20px;
            color: white;
        }

        .ybl {
            background-color: #10c55b;
            font-size: 20px;
            color: white;
        }

        .YZ {
            POSITION: absolute;
            RIGHT: 10PX;
            TOP: 10PX;
            FONT-SIZE: 70PX;
            COLOR: #ff0000;
            line-height: 70px;
        }

        .bl {
            POSITION: absolute;
            RIGHT: 20PX;
            TOP: 10PX;
            FONT-SIZE: 40PX;
            COLOR: lightgray;
            line-height: 70px;
        }

        .kx {
            background-color: #10c55b;
        }

        .rtable th, .rtable td {
            font-size: 10px;
        }

        .weui-media-box_appmsg .weui-media-box__hd {
            margin-right: .5em;
            font-size: 30px;
            text-align: center;
        }
    </style>
</head>
<body style="background-color: #f8f8f8;" ms-controller="USERINFO">
    <div class="page badge js_show">
        <div class="page__hd">
            <div class="weui-flex">
                <div class="head-oneself">
                    <img ms-attr-src="/images/xszp/{{userinfo.jsdm}}.jpg" onerror="javascript:this.src='/ViewMob/images/tx1.gif';" style="border-radius: 5%; width: 100%; height: 100%; margin-left: -5px" />
                </div>
                <div class="weui-flex__item">
                    <h1 class="page__title" style="text-align: left; margin-top: 16px; margin-left: 15px;">姓名：{{userinfo.xm}}【{{userinfo.xb}}】</h1>
                    <h1 class="page__title" style="text-align: left; margin-top: 16px; margin-left: 15px;">工号：{{userinfo.xh}}</h1>

                </div>
            </div>


        </div>
        <div class="page__bd">
            <div class="weui-cells" style="margin-top: 0px">
                <div class="weui-cell">
                    <div class="weui-cell__bd">所在院系</div>
                    <div class="weui-cell__ft" style="font-size: 0">
                        <span style="vertical-align: middle; font-size: 17px;">{{userinfo.xbmc}}</span>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__bd">专业</div>
                    <div class="weui-cell__ft" style="font-size: 0">
                        <span style="vertical-align: middle; font-size: 17px;">{{userinfo.zymc}}</span>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__bd">班级</div>
                    <div class="weui-cell__ft" style="font-size: 0">
                        <span style="vertical-align: middle; font-size: 17px;">{{userinfo.bj}}</span>
                    </div>
                </div>
            </div>




            <div class="weui-cells">
                <div class="weui-panel__hd">个人信息 <span style="float: right">选中后信息对班级内成员隐藏</span> </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">手机号</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入手机号" ms-duplex="userinfo.now_smscode">
                    </div>
                    <label for="sfsmscode" class="weui-switch-cp">
                        <input class="weui-switch-cp__input" type="checkbox" id="sfsmscode" ms-duplex-checked="userinfo.sfsmscode">
                        <div class="weui-switch-cp__box"></div>
                    </label>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">qq</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入qq号" ms-duplex="userinfo.now_qq">
                    </div>
                    <label for="sfqq" class="weui-switch-cp">
                        <input class="weui-switch-cp__input" type="checkbox" id="sfqq" ms-duplex-checked="userinfo.sfqq">
                        <div class="weui-switch-cp__box"></div>
                    </label>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">邮箱</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" placeholder="请输入邮箱" ms-duplex="userinfo.now_email">
                    </div>
                    <label for="sfemail" class="weui-switch-cp">
                        <input class="weui-switch-cp__input" type="checkbox" id="sfemail" ms-duplex-checked="userinfo.sfemail">
                        <div class="weui-switch-cp__box"></div>
                    </label>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">微信</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" placeholder="请输入微信" ms-duplex="userinfo.now_wxid">
                    </div>
                    <label for="sfwx" class="weui-switch-cp">
                        <input class="weui-switch-cp__input" type="checkbox" id="sfwx" ms-duplex-checked="userinfo.sfwx">
                        <div class="weui-switch-cp__box"></div>
                    </label>
                </div>
                <div class="weui-cells">

                    <div class="weui-cell weui-cell_select weui-cell_select-before" id="city">
                        <div class="weui-cell__hd" style="text-align: left; padding-left: 15px;">
                            <label class="weui-label">地址</label>
                        </div>
                        <div class="weui-cell__hd" style="width: 30%">
                            <select class="weui-select prov"></select>
                        </div>
                        <div class="weui-cell__hd" style="width: 30%">
                            <select class="weui-select city"></select>
                        </div>
                        <div class="weui-cell__hd" style="width: 30%">
                            <select class="weui-select dist"></select>
                        </div>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">地址</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" placeholder="请输入地址" ms-duplex="userinfo.now_addr">
                    </div>
                    <label for="sfaddr" class="weui-switch-cp">
                        <input class="weui-switch-cp__input" type="checkbox" id="sfaddr" ms-duplex-checked="userinfo.sfaddr">
                        <div class="weui-switch-cp__box"></div>
                    </label>
                </div>
            </div>
        </div>

        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" ms-click="savejbxx()">保存信息</a>
        </div>
        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_warn" href="javascript:" ms-click="clearuser()">解除微信绑定</a>
        </div>
    </div>


    <script src="../js/jquery-1.11.1.min.js"></script>
    <script src="/ViewMob/js/avalon1.47.js"></script>
    <script src="/WEB/JS/jquery.cityselect.js"></script>
    <script>


        var model = avalon.define({
            $id: "USERINFO",
            userinfo: {},
            selssh: "",
            selindex: "",
            zxdk: "0",
            xcjf: "0",
            useryhqx: "",
            clearuser: function () {
                var lyindex = layer.open({
                    content: "确定要清除用户绑定信息吗？",
                    btn: ['确定', '取消'],
                    shadeClose: false,
                    yes: function () {
                        $.getJSON("/API/VIEWAPI.ashx?ACTION=Commanage_JCBDXX", { xh: model.userinfo.xh }, function (result) {
                            if (result.ErrorMsg == "") {
                                setCookie("openid","");
                                setCookie("userdata","");
                                location.href = "UI_INDEX.html";
                            }
                        })
                    }, no: function () {
                        layer.close(lyindex);

                    }
                });
              
            },
            savejbxx: function () {
                if (!model.userinfo.now_smscode) {
                    alert("手机号不能为空");
                }
                if ($("#sfsmscode").prop("checked")) {
                    model.userinfo.sfsmscode = "1"
                } else {
                    model.userinfo.sfsmscode = ""
                }

                if ($("#sfemail").prop("checked")) {
                    model.userinfo.sfemail = "1"
                } else {
                    model.userinfo.sfemail = ""
                }

                if ($("#sfwx").prop("checked")) {
                    model.userinfo.sfwx = "1"
                } else {
                    model.userinfo.sfwx = ""
                }

                if ($("#sfqq").prop("checked")) {
                    model.userinfo.sfqq = "1"
                } else {
                    model.userinfo.sfqq = ""
                }

                if ($("#sfaddr").prop("checked")) {
                    model.userinfo.sfaddr = "1"
                } else {
                    model.userinfo.sfaddr = ""
                }
                model.userinfo.now_province = $("#city").find(".prov").val();
                model.userinfo.now_city = $("#city").find(".city").val();
                model.userinfo.now_district = $("#city").find(".dist").val();
                $.post("/API/VIEWAPI.ashx?Action=Commanage_SAVEDATA&r=" + Math.random(), { data: JSON.stringify(model.userinfo.$model) }, function (resultData) {
                    if (JSON.parse(resultData).ErrorMsg == "") {
                        setCookie('userdata', JSON.stringify(JSON.parse(resultData).Result));
                        model.userinfo = JSON.parse(getCookie('userdata'));
                        alert('操作成功')
                        location.reload()
                    }
                });
            }
        })
        avalon.ready(function () {
            model.userinfo = JSON.parse(getCookie('userdata'));
            $("#city").citySelect({
                prov: model.userinfo.now_province,
                city: model.userinfo.now_city,
                dist: model.userinfo.now_district,
                nodata: "none"
            });
            //$.getJSON("/API/VIEWAPI.ashx?ACTION=GH_GHMDBYJSDM", { P1: jsdm }, function (result) {
            //    if (result.Result.length == 0) {
            //        location.href = "UI_ERROR.html";
            //    } else {
            //        model.userinfo = result.Result[0];
            //    }
            //})
        })
        function getCookie(name) {
            var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

            if (arr = document.cookie.match(reg))

                return unescape(arr[2]);
            else
                return null;
        }
        function setCookie(name, value, t) {
            var Days = 30;
            var exp = new Date();
            if (t) {
                exp.setTime(exp.getTime() + parseInt(t) * 24 * 60 * 60 * 1000);
            } else {
                exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
            }
            if (window.location.toString().indexOf("qijieyun") > 0) {
                document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/;domain=qijieyun.com";
            } else {
                document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
            }
        }
    </script>
</body>
</html>
